package com.bjc.principle.factorymethod.order;

import com.bjc.principle.factorymethod.pizza.BJCheesePizza;
import com.bjc.principle.factorymethod.pizza.BJPepperPizza;
import com.bjc.principle.factorymethod.pizza.Pizza;

/**
 * @program: DesignPattern
 * @description:
 * @author: bjc
 * @create: 2020-12-16 20:39
 */
public class BJOrderPizza extends OrderPizza{
    Pizza createPizza(String orderType) {
        Pizza pizza = null;
        if (orderType.equals("cheese")){
            pizza = new BJCheesePizza();
        }else if (orderType.equals("pepper")){
            pizza = new BJPepperPizza();
        }
        return pizza;
    }
}
